package com.example.test4.com.it.Service;

import com.example.test4.com.it.dao.CompanyDao;
import com.example.test4.com.it.domain.Company;
import com.example.test4.com.it.query.CompanyQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName CompanyServiceImpl
 * Descrition TD00
 * Author Zhang Hai Xia
 * date 2021/10/23 16:49
 * @Version 1.0
 */

@Service
@Transactional
public class CompanyServiceImpl implements ICompanyService {


    @Autowired
    CompanyDao companyDao;

    @Override
    public List<Company> findAll() {
        return companyDao.findAll();
    }

    @Override
    public Company findOne(Integer id) {
        return companyDao.findOne(id);
    }

    @Override
    public void save(Company company) {

        companyDao.save(company);
    }

    @Override
    public void delete(Integer id) {
        companyDao.delete(id);
    }

    @Override
    public List<Company> findBy(CompanyQuery query) {
        return companyDao.findBy(query);
    }
}
